package com.hippo.core.tuya

import com.hippo.core.R
import com.hippo.core.config.AppConsts




fun String?.toControlType():Int{
    return when(this){
        DpValue.Mode.smart -> AppConsts.ControlType.AUTO
        DpValue.Mode.spiral -> AppConsts.ControlType.EDGE
        DpValue.Mode.random -> AppConsts.ControlType.MANUAL
        DpValue.Mode.standby -> AppConsts.ControlType.STANDBY
        else -> AppConsts.ControlType.NONE
    }
}

fun String?.toSpeedy():Int{
    return when(this){
        DpValue.Suction.gentle -> 1
        DpValue.Suction.normal -> 2
        DpValue.Suction.strong -> 3
        else -> 0
    }
}

fun Int.toWifiResId(): Int {
    return if(this > -50){
        return R.mipmap.wifi_3
    }else if(this > -67){
        return R.mipmap.wifi_2
    }else if(this > -80){
        return R.mipmap.wifi_1
    }else{
        return R.mipmap.wifi_0
    }
}